package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
        try {
            p.setAge(10000);//满足语法，但是不满足业务
        } catch (IllegalAgeException e) {
            e.printStackTrace();
        }
        System.out.println("此人年龄是"+p.getAge()+"岁");
    }
}
